﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace Hs.CardUt.D3
{
    public class D3Port
    {
        [DllImport("dcrf32.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern int dc_init(Int16 port, int baud);  //初试化


        [DllImport("dcrf32.dll")]
        public static extern int dc_exit(int icdev);
        [DllImport("dcrf32.dll")]
        public static extern int dc_reset(int icdev, uint sec);

        [DllImport("dcrf32.dll")]
        public static extern int dc_request(int icdev, char _Mode, ref uint TagType);

        // Token: 0x0600001E RID: 30
        [DllImport("dcrf32.dll")]
        public static extern short dc_card(int icdev, char _Mode, ref ulong Snr);

        // Token: 0x0600001F RID: 31
        [DllImport("dcrf32.dll")]
        public static extern short dc_card(int icdev, char _Mode, [MarshalAs(UnmanagedType.LPStr)] StringBuilder Snr);

        // Token: 0x06000020 RID: 32
        [DllImport("dcrf32.dll")]
        public static extern int dc_halt(int icdev);

        // Token: 0x06000021 RID: 33
        [DllImport("dcrf32.dll")]
        public static extern int dc_anticoll(int icdev, char _Bcnt, ref ulong IcCardNo);

        // Token: 0x06000022 RID: 34
        [DllImport("dcrf32.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern int dc_beep(int icdev, uint _Msec);

        // Token: 0x06000023 RID: 35
        [DllImport("dcrf32.dll")]
        public static extern int dc_authentication(int icdev, int _Mode, int _SecNr);

        // Token: 0x06000024 RID: 36
        [DllImport("dcrf32.dll")]
        public static extern int dc_authentication_passaddr(int icdev, int _Mode, int _SecNr, [In] string sdata);

        // Token: 0x06000025 RID: 37
        [DllImport("dcrf32.dll")]
        public static extern int dc_authentication_passaddr_hex(int icdev, int _Mode, int _SecNr, [In] string sdata);

        // Token: 0x06000026 RID: 38
        [DllImport("dcrf32.dll")]
        public static extern int dc_authentication_pass(int icdev, int _Mode, int _SecNr, [In] string sdata);

        // Token: 0x06000027 RID: 39
        [DllImport("dcrf32.dll")]
        public static extern int dc_authentication_pass_hex(int icdev, int _Mode, int _SecNr, [In] string sdata);

        // Token: 0x06000028 RID: 40
        [DllImport("dcrf32.dll")]
        public static extern int dc_load_key(int icdev, int mode, int secnr, [In] byte[] nkey);

        // Token: 0x06000029 RID: 41
        [DllImport("dcrf32.dll")]
        public static extern int dc_load_key_hex(int icdev, int mode, int secnr, string nkey);

        // Token: 0x0600002A RID: 42
        [DllImport("dcrf32.dll")]
        public static extern int dc_write(int icdev, int adr, [In] string sdata);

        // Token: 0x0600002B RID: 43
        [DllImport("dcrf32.dll")]
        public static extern int dc_write_hex(int icdev, int adr, [In] string sdata);

        // Token: 0x0600002C RID: 44
        [DllImport("dcrf32.dll")]
        public static extern int dc_read(int icdev, int adr, [Out] byte[] sdata);

        // Token: 0x0600002D RID: 45
        [DllImport("dcrf32.dll")]
        public static extern short dc_read(int icdev, int adr, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sdata);

        // Token: 0x0600002E RID: 46
        [DllImport("dcrf32.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern short dc_read_hex(int icdev, int adr, ref byte sdata);

        // Token: 0x0600002F RID: 47
        [DllImport("dcrf32.dll")]
        public static extern short dc_read_hex(int icdev, int adr, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sdata);

        // Token: 0x06000030 RID: 48
        [DllImport("dcrf32.dll")]
        public static extern void hex_a(ref string oldValue, ref string newValue, int len);

        // Token: 0x06000031 RID: 49
        [DllImport("dcrf32.dll")]
        public static extern short dc_initval(int icdev, int _Bcnt, [In] uint IcCardNo);

        // Token: 0x06000032 RID: 50
        [DllImport("dcrf32.dll")]
        public static extern short dc_readval(int icdev, int _Bcnt, ref uint IcCardNo);

        // Token: 0x06000033 RID: 51
        [DllImport("dcrf32.dll")]
        public static extern short dc_increment(int icdev, int _Bcnt, [In] uint IcCardNo);

        [DllImport("dcrf32.dll")]
        public static extern Int16 dc_card(int icdev, char _Mode, out long _Snr);
        // Token: 0x06000034 RID: 52
        [DllImport("dcrf32.dll")]
        public static extern short dc_decrement(int icdev, int _Bcnt, [In] uint IcCardNo);

        // Token: 0x06000035 RID: 53
        [DllImport("dcrf32.dll")]
        public static extern short dc_dispinfo_T8(int icdev, short sline, short offset, [In] string infodata);
    }
}
